add edit code to plan