First game loop routines implemented