Added undoing stuff.

Added undoing stuff.