some debugging code in geometry routines, added gnuplot script to one example