added some better control to contour.py