Adding automatic incrementing oridinal counters to template variable scopes