Wrote up algorithms for use in the example. Some explanatory text already in place, but still needs some.