I do think that it is legitimate to talk of goals and functions in nature, and that these things can be made sense of in naturalistic terms. There is nothing at all contrary to naturalism in the idea of goal-directed systems.