This isn't enough documentation to explain this algorithm. The code doesn't really explain what the meaning of the constant arrays at the top of this file mean. Can you document this more?