Working contour finding and forest generation