Multiple applications of a function