adding modes function and adding more efficient rand! for invertedgamma