added method to generate DAG