addded inFile.Seek instead of opening inFile twice