Add gnuplot, some algo changes