erase now works with undo, and paste works in the right direction.