change num_of_bits to quantity