added some code for glmer, but it needs work