adding rarity map to lib and unit tests