Added comment header for generate_ending().