added code and example