Updates to principal curves.
Closer implementation to the polygonal paper.