Code refactoring and comments. Fix #13
Merge pull request #17 from babausse/enhancement/refactoring

Code refactoring and comments. Fix #13