Corrected input of data and names of files