added better threadable rand