First version of iterated function application