adding edges to graphi and bug fix