use pow2 in lieu of fdim in finding pattern fit