Scans through input file line by line