firs working implementation of spectral substraction