traverse pop array elements