Adding fuctions to query spectra