Most of the algorithm ready for first release.