Use bitwise ops to calculate offset