moved rms calculation to a separate task