retext cloned from http://retext.sourceforge.net/