Now outputs fitted magnitudes to files