adding data structure problems in arrays