implementing functions higher order 8763681