-Fixed a minor problem with the algorithm