added code and usage example