simplified implementation of the comparer