method calcSpline moved out of drawSpline