Added ability to change edges weights