updated the edges code