refactored edge weights code for edges and transition edges, not done yet