apply function. #3 example. function as an object