simple lookup table for zigzag sorting