First version of comparator