add more tests for out-of-order and repitition edge cases