added --nline, fixed console and outfile printing using list comprehensions. Code paragraphs - to make it more readable!