Updated code to use the sign bit + now it assumes 12 bits as the initial precision