added zig zag method