calculating the number of bits needed instead of asking teh user