Optimized the speed of game.
Fixed a posible bug