add comments, refactor
Merge remote-tracking branch 'origin/master'