moved to function for spectrum, update to plotting