Added scan routine to calculate proper spectrum and tuning