javascript doesn't have block scope. It's more readable to put closest inside the for loop