Done more work for setting up rands