Changed how rand works