adding edges to graph smaller setand bug fix