Building out planner function