implemented initial game loop