A pipeline for reducing long slit spectra