added curvature code to matlab script