I spent two years trying to fix the gender imbalance in my stories: Here’s what I’ve learned, and why I did it