Updated exception handling.  Added some comments.