fix up wrapper script and rewrite documentation