Implemented basic game loop