code rigged to handle erroneous plyfile contours