Added some documentation and a test.