Mr. Math is Leonardo's algebra teacher in a dream he has about attending a Mutant Turtle school. When Leonardo starts daydreaming (in his dream) about surfing, Mr. Math accuses him of being on drugs, to which the young turtle says he's just "naturally goofy". He asks his student to solve an equation, which Leo continuously gets incorrect. Leo then starts wondering what it'd be like if the teacher turned into a monster... which then turns out to be "true". Mr. Math attacks the classroom, including the girl Leo has the hots for, Melissa. Leo attacks Mr. Math and kills him with his sword.
Leo's victory is short-lived, as the substitute, Miss Gnarl, is a Tyrannosaurus Rex who intends on giving the algebra class a surprise history quiz, with fatal results for those who fail.