Usage of bezierFit for merging ends
mergeEnds in separate function
flipCUrves in separate function
use of intersections in valid