TailRec should be sealed, or a MatchError would be thrown