Developing and optimized code to fit an obs spectrum to theoretical spectra databese