add plotting of dgraph
clean up printing of tests
fix a minor bug

also add some tests for pseudo-inverse