How does the sentence end?

Nick is bad at writing letters, but William is great at them. This is due to
Nick preferring math class.