clarifying needToCompare function.