Goal-Directed Behavior in Life and Non-Life