Cleaned up code, added comments.  Edited text