added game loop

TO DO: simplify calculations, too complex