started threading randomness into the Var type and functions