manual iterating  over arrays