Removed unnecessary code in the while loop used to read the file.