switching from enhanced for loop