refactored summate and error message code for shorter, more readable messages.