Tested add_edge function. Works fine