Residual Balancing: A Method of Constructing Weights for Marginal Structural Models