added powerlaw random number function