Lots if fixes and improvements.
Added an 'undo' button