Modified write_cal to save old calibration files