makess avoid edge effects fitting quadratic