fixed example script, added documentation