fixed some random number stuff
fixed tests
Merge pull request #81 from hal3/master

fixed some random number generation stuff and tests