Added some comments, made minor edits.