I'm writing an application from a tutorial that is a to-do list but I'm a little confused on why its setup this way and could use other perspectives.

Why would I return an item from a function if I append to a global array within the function? Why wouldn't we just query the array for this item. I'm not catching onto why this item is being returned or how its being used.

```
import Foundation
import UIKit

class ItemStore {

    var allItems =  [Item]()

    func createItem() -> Item {
        //use a constant to initialize a new item using the Item class's syntax
        let newItem = Item.init(random: true)
        //now append it to this class's allItems array
        allItems.append(newItem)
        //now according to this function we need to return an Item object.  Now return newItem....but why are we returning it if we just appended it to the allItems array??  Can't we just query the array for this item?  I wonder how this returned item is going to be used now
        return newItem
    }

    //now I'm going to add a designated initializer to this class which will add five random items to the allItems array....arrgghh, whhyyy??
    init() {
        for _ in 0..<5 {
            createItem()
        }
    }
}

```