Makes sort ns comparator configurable

- adds length comparator