the first version of the comparator