added comment to show how edge weights are referenced