add comparison function