additions, refactoring, comments