Added comments & quick refactoring