First version of the Toyoda algorithm.
Fixed a typo.