added averaging into the mu scan
functional version of mu_scanner