Added writeToOperationHistory() and writeToUndoHistory() Methods