Use current pass index instead of a loop