fixing randomness
changing double random number generation because paranoia