update zigzag conversion