added game loop feature