added test for comparator, should be good for production use