modify ZigZag Conversion