changed contour computing method