Added function to convert a number into bits.
Added function to convert bits into a number.
No longer crashes.