Changed curvature solving from only putting together one piece to recursively putting together all the pieces