     
     /// Accesses and sets elements for a given flat index position.
     /// Currently, setter can only be used to replace non-optional values.
-    public subscript (position: Index) -> Element? {
+    public subscript (position: Index) -> T? {
         get {
             let pageIndex = page(for: position)
             

            guard let newValue = newValue else { return }
            
            let pageIndex = page(for: position)
            elements[pageIndex]?[position % pageSize] = newValue
        }
    }
}

/// mechanisms to scrolling UI elements such as `UICollectionView` and `UITableView`.
///
public struct PagedArray<T> {
    public typealias PageIndex = Int
    
    /// The datastorage
    public fileprivate(set) var elements = [PageIndex: [T]]()
    
    // MARK: Public properties
    
