Organizing gameloop

Organizing gameloop