added edge weights to graph calculations