Game window now closes, improves code