matrices using glm