parts of contour detextion implemented