use polyfit function to fit data
finish chapter4