changes to @kmiernik's Pyspectr