reorganisation of comparator