Some changes to calculate edge length which i'm not in favour of