Updated code with discard changes functionality. Save and discard changes buttons will activate/deactivate user presses the discard/save button or manually reverts changes.