fixed minor typo and improved commenting.