added code for random slope and intercept model