typo.
comments + minor refactoring