second version of zigzag, much better that first one