added nan_polyfit function
added mean of profiles function