add zigzag conversion.