Added a comparison function