Planning, lessons and learning