See http://jpspan.sourceforge.net/wiki/doku.php?id=examples for description