use count_ones
faster