improved for loop