graph implementation fixes