Writing output to txt file and first try at gnuplot graphing