changing % 2  to & 0x01 for performance purpose. 
but it looks there is no effict