clean up, minor refactoring, adding comments
code clean up, comments, style