adding zigzag.cpp