added raw comparator implementation