Adding comments to program and fixing gnuplot function