Trying to figure out for loop