Changed how I got the bit values completely

I went from an extremely abstract and rather ugly method of getting the
value of the code to a much faster and clean method using bit shifting.
Also added more variables that will be used later on