Goal-Directed behavior in life and non-life