Fixed handling for each line of input