tabs -> spaces, trailing whitespace.
General clean-up: use iterators!
Use more vector functions.
Switch to using a faster non-crypto RNG.