added a traverse function to the array