Added main 'does it work' test for the dag algorithm.