small changes to glm code (not usable)