add CurveArray class to nest or flatten an array