check with two test cases that all the ugraph is correct