Adding extra code for doing power spectra