Added new mixed effects code