change code to use glm math library