working on fixing the trimcurve method to make it work correctly.