be greed to optimize the comparison function for nvalue