More randomness. Needs testing.
Refactoring