Expanded countbits to include bit 9, the 'solved bit', and also chnaged scratchpad cnb[] to be unsigned to avoid problems with sign bit later