added error enum
fixed memory leak
added struct for a sequence of b-splines
use sequence for split
applied naming convention