rms on a single for loop