Added -o option to output to text file