Added possibility to edit plans. Needs testing.