input and output files
solved, but it is taking to long
trying to optimize