Re-structure code. zig-zag indices.