keeps track of totalEdgeLength