Implemented reading lines from stdin