added a check that the output file size doesnt change too much