Some minor corrections. Algorithm still not updating.