added a comment and changed a few var names for posterity's sake