add least-square fitting script