implementing functions higher order 5738758