added some docs and tests to createComparator