Implemented exit and basic game loop