Added some documentation and fixed the example.