Merge pull request #19 from nairys/statistics

Statistics updated
minor refactoring. more to be done
Merge branch 'master' into statistics