Updated mixed models code