initial changes
first try to integrate spectra class
changes for making it work
fixed some more errors