moved all spectrum from main.py to spectrum.py, work ok so far.