trying to implement fitting method to power laws