better-fying the zig zag function and making it settable via properties