shifting auxiliary function bitcount from Tools to CardsValue