Added make_dag function.

 - moved make_dag out of betweennes function.
 - updated test.