Right approach, but not sophisticated enough

Todo: Drop offset counter throughout, account for the fact that
terms with leading zeroes are not duplicated exactly.