getting close to a loop in a loop in a loop