Corrected Looping Over Arrays