updated documentation and added example.