higher order functions updated