implemented processLine()