conflicts resolved and more refactoring
Merge pull request #24 from nairys/statistics

conflicts resolved and more refactoring