Added tests to test the undo function