Convert an into to a bit array string to see what you're doing in bit operations in python.
def bit_str(i): ''' converts an int into a string of bits to show what it looks like in bits ''' return bin(i)[2:]