Whole algorithm
Problems arise with adding new nodes.  Extensive testing ahead.
Algorithm is a success!
Preparing to merge this into master