Better debugging printouts, added random number generators.