worked on client game loop