Refactored.  Added more comments.