Added buildGraph