This is Version 1. Test5 fails. V1 does not account for non-consecutive labeling.