changed some functions to use the glfw features