Modified version of nPower by Neal/renstrom