Planner algorithm second commit