Improved documentation, added example.