Added listeners for buttons and redo/undo and sum support