alg3

Made an alternative function for d1 to simplify it and fix problems.
Added a function to graph.py which is included in graph_2.py, alg1_2 and
alg_2 only differ in that they import from these new versions rather
than graph and alg1.