fixed typos
added deterministic randomness