add equal function
higher order functions