Reading and outputin lines