Note that current implementation is somewhat ad-hoc, and not in line with the algorithm of the paper.