for loop, switch and array