Added check for saving a blank event name
Cleanup code and add comments