make if-else more explicit in .glm2grid