functional programming-higher order function