generalizing unf comparator