untested version of spect3.py