change updateState() to rely on only a single random variable r