fixing the random vector generation