Added filter for turning points.
Also improved interaction with gnuplot.