added example code from blog post