Add documentation

This fixes #15 
I think this is a potential error which would be fine in some cases but is dangerous in documentation because people will copy this code and use it in their projects.