I agree, the original code looks suspicious. It does a shift then checks the LSB but overwrites it as it moves through each byte. It goes through the motions of converting to a single bit doesn't produce a result. Each time it goes through the 'for' loops it should store 'bit' somewhere. How it achieves that will depend on the desired format of the output, for example is it ASCII representations of the bits or is each bit returned as a different variable or in an array.