The above way is perfectly valid, but it can be done with fewer shifts. I also find index-to-index shifts to be a little awkward. The way I was taught do a two-octave G major scale went like this (with shifts as marked by the "S" at bottom):
Code:
G----------------------------9-11-12
D------------------7-9-10-12--------
A-----2-3-5-7-9-10------------------
E-3-5-------------------------------
S S