Expressing a function as a composition of two functions