Implement foreach structure