move part of rarity calculation here (untested)
Merge branch 'rarityOptimization' of https://github.com/intron/ecolor