Modifying code to fit the plan