Required complexity added to popup
Added an undo function