Building up and plotting the DAG