added plot function, fixed multiple covariate bug