replaced pyglet library and fixed references