yeah i understand how it works, i just dont see how the decoded part of the code works. you need to first decode index at zero before you start moving through the rest of the decoding process. the code says start at counter=0 and move left 1, this does not invert the correct bit.