Termination was a little tricky because of prefixes length