Refactored saveEvent sum for better logic flow
Refactored saveEvent some for better logical flow
Added extra comments and various cleanup
Merge remote-tracking branch 'origin/workingbranch'