contour picking code works