added more comments
small refactor