added initial version of gameloop