Added documentation and an example.