Moved game loop logic out of Main method