Added some unit information to the codebook and modified slightly to tweak some variable names