added delete and undo
undo NOT tested. changed front-end