problem min length and changed delete to undo