zigzag conversion added