The for to next loops in both routines are using the same loop variable "loop".