added documentation and a minified version