added elliptical fit function