implement plan code