tweaked the fileReader method