changes to glm code