compose function can now compose of n functions (not just 2)