Update cookbook.rst

I think the 'alternative approach' is in the wrong place
Merge pull request #1108 from steffann/patch-1

Update cookbook.rst