assumes collection is already sorted