changed to reduce the number of output parameters in files