Tweaked sample construction code