Fixed findNecessaryBitwidth to account for the maximun string number as well