been a while since I've looked at this, but my bit function is a boolean function that returns whether or not a certain bit of an integer is on.
If you use your twoToThe array that you initialized in init(), the bit function can be written in literally one line of code. Think about using a certain element of your twoToThe array as a bitmask. For example, if you want to know if the 5th bit is on, use the 5th element of your array as a bitmask.