fixed typo and did some minor changes to comments