Modifying AI, Enhancing Essays: How Active Engagement with Generative AI Boosts Writing Quality