First round of code review to see how github process (fork/pull request) works

I did skim through the source code and add some comments for you to consider and discuss with me.

Mainly I want to test github's code review system. More info:
https://help.github.com/articles/using-pull-requests