correcting calculation error in files