Work done on unit-testing on x.sortedIndex, x.merge, x.initial, x.rest,
x.compact