added code and example.