Fixed loops starting at 0 instead of 1