Implemented compare contours method
Corrected compare contour algorithm