added flexible function support for power law fit