updated function composition.