added resampling for the 2d curves and minor corrections