tweaking on the algorithm description...