updated function composition