solve now returns the list of actions taken to reach the goal