filled out BinCount untested code