cleaned up code a bit and made opengl look better