fixed bug with undo() and clear() both now work as intended