works with new graph implementation