Tweaked code sample