This seems an odd name for the function. Really you're just counting the number of 0's and 1's, right?