Fixed polarity bug
Added mtrand