Binary count problem solved