Added some comments.  More refactoring