Implemented game loop