add planner and planning code