Wrote a DBGenerator, improved PR algorithm.