Changes per feedback

including explicit inclusion of "message" attribute on custom exceptions
and rearranging functions.