Added rest of calculations for edges