helper functions
curvature