added fit to script