Added sample code and made minor adjustments