I did this plot a while ago as FxM and both stories fell out so I figured it'd be much more fun to try it with FxF.
My character who is the nerd is dating the most popular girl in school, the difference between this cheerleader and most cheerleaders is that she really is in love with my character. But, they both have a secret between each other, the cheerleader is her Mistress. So, one day my character ends up getting detention for the first time in her life and for what? Well, just getting caught masturbating in the girl's bathroom. So, your character finds out and when the teacher is not in the room she decides to punish her there.