Changed random variables to factors