improved MCF math

number of edges no longer affects curvature calculation
reorganized code