Cleaned code. Moved to my own psuedo-random number generator.