Refactor, add comments.
Merge pull request #11 from LavirtheWhiolet/refactor_and_comments

Refactor and comments.