used xor and integer look up...makes it a little faster.