Added game-loop funcionality