Added random seed
Added vectorized version for sigma update