Implemented median curvature computation