Improved tests and docstring example.