tweaked algorithm
Merge pull request #99 from nairys/fix_analytics

tweaked algorithm