The graph works as long as you pass in the right arraylist.