Added 'foreach' with reference