changed sort input and output files