Fiddled with the random number generation again. Doesn't seem a whole lot better...