started implementing main game loop