fixed rms and file reading