Fixed schoolboy error! for loop should start with 0, not 1.