modified main.m to get contours