Reconstructed the query for the PBF. Implemented a better method of random numbers.w