added del and undo button functionality