changed random vector to uniform distribution, other minor changes