Tweaks to code to run frequency and zero frequency