add a script for curve fitting and complete test programs