         removeFirstObject(object)
     }
 
-    /// EZSE: Removes the first given object
-    public mutating func removeFirstObject(_ object: Element) {
-        if let index = self.index(of: object) {
-            self.remove(at: index)
-        }
-    }
-
-    /// EZSE: Removes all occurrences of the given object
-    public mutating func removeObjects(_ object: Element) {
-        for i in self.indexes(of: object).reversed() {
-            self.remove(at: i)
-        }
-    }
-
-    /// EZSE: Checks if the main array contains the parameter array
-    @available(*, deprecated: 1.7, renamed: "contains(array:)")
-    public func containsArray(_ lookFor: [Element]) -> Bool {
-        return contains(array: lookFor)
-    }
-
-    /// EZSE: Checks if the main array contains the parameter array
-    public func contains(array lookFor: [Element]) -> Bool {
-        for item in lookFor {
-            if self.contains(item) == false {
-                return false
-            }
-        }
-        return true
-    }
-}
-
-public func ==<T: Equatable>(lhs: [T]?, rhs: [T]?) -> Bool {
-    switch (lhs, rhs) {
-    case (.some(let lhs), .some(let rhs)):
-        return lhs == rhs
-    case (.none, .none):
-        return true
-    default:
-        return false
-    }
-}
+}
+
+//MARK: - Deprecated 1.6
+
+extension Array {
+
+    /// EZSE: Iterates on each element of the array.
+    @available(*, deprecated: 1.6, renamed: "forEach(_:)")
+    public func each(_ call: (Element) -> ()) {
+        forEach(call)
+    }
+
+    /// EZSE: Creates an array with values generated by running each value of self
+    /// through the mapFunction and discarding nil return values.
+    @available(*, deprecated: 1.6, renamed: "flatMap(_:)")
+    public func mapFilter<V>(mapFunction map: (Element) -> (V)?) -> [V] {
+        return flatMap { map($0) }
+    }
+
+    /// EZSE: Iterates on each element of the array with its index.  (Index, Element)
+    @available(*, deprecated: 1.6, renamed: "forEachEnumerated(_:)")
+    public func each(_ call: @escaping (Int, Element) -> ()) {
+        forEachEnumerated(call)
+    }
+
+}

        return Swift.max(self.count - 1 - index, 0)
    }

    /// EZSE: Returns an array with the given number as the max number of elements.
    public func takeMax(_ n: Int) -> Array {
        return Array(self[0..<Swift.max(0, Swift.min(n, count))])
    }

    /// EZSE: Iterates on each element of the array.
    @available(*, deprecated: 1.6)
    public func each(_ call: (Element) -> ()) {
        for item in self {
            call(item)
        }
    }

    /// EZSE: Iterates on each element of the array with its index.  (Index, Element)
    @available(*, deprecated: 1.6, renamed: "forEachEnumerated(_:)")
    public func each(_ call: (Int, Element) -> ()) {
        forEachEnumerated(call)
    }

    /// EZSE: Iterates on each element of the array with its index. (Index, Element)
    @available(*, deprecated: 1.7, renamed: "forEachEnumerated(_:)")
    public func forEach(_ call: (Int, Element) -> ()) {
        forEachEnumerated(call)
    }

    /// EZSE: Iterates on each element of the array with its index. (Index, Element)
    public func forEachEnumerated(_ call: (Int, Element) -> ()) {
        for (index, item) in self.enumerated() {
            call(index, item)
        }
    }

    /// EZSE: Creates an array with values generated by running each value of self
    /// through the mapFunction and discarding nil return values.
    @available(*, deprecated: 1.6, renamed: "flatMap")
    public func mapFilter<V>(mapFunction map: (Element) -> (V)?) -> [V] {
        var mapped = [V]()
        forEach { (value: Element) -> Void in
            if let mappedValue = map(value) {
                mapped.append(mappedValue)
            }
        }
        return mapped
    }

    /// EZSE: Prepends an object to the array.
    @available(*, deprecated: 1.7, renamed: "insertFirst(_:)")
    public mutating func insertAsFirst(_ newElement: Element) {
        insertFirst(newElement)
    }

    /// EZSE: Prepends an object to the array.
    public mutating func insertFirst(_ newElement: Element) {
        insert(newElement, at: 0)
    }

    /// EZSE: Shuffles the array in-place using the Fisher-Yates-Durstenfeld algorithm.
    public mutating func shuffle() {
        var j: Int

        for i in 0..<(self.count-2) {
            j = Int(arc4random_uniform(UInt32(self.count - i)))
            if i != i+j { swap(&self[i], &self[i+j]) }
        }
    }

    /// EZSE: Decompose an array to a tuple with first element and the rest; useful in Functional Programming
    public func decompose() -> (head: Iterator.Element, tail: SubSequence)? {
        return (count > 0) ? (self[0], self[1..<count]) : nil
    }

}

extension Array where Element: Equatable {

    /// EZSE: Returns the indexes of the object
    @available(*, deprecated: 1.7, renamed: "indexes(of:)")
    public func indexesOf(_ object: Element) -> [Int] {
        return indexes(of: object)
    }

    /// EZSE: Returns the indexes of the object
    public func indexes(of object: Element) -> [Int] {
        var indexes = [Int]()
        for index in 0..<self.count {
            if self[index] == object {
                indexes.append(index)
            }
        }
        return indexes
    }

    /// EZSE: Returns the last index of the object
    @available(*, deprecated: 1.7, renamed: "lastIndex(_:)")
    public func lastIndexOf(_ object: Element) -> Int? {
        return lastIndex(of: object)
    }

    /// EZSE: Returns the last index of the object
    public func lastIndex(of object: Element) -> Int? {
        return indexes(of: object).last
    }

    /// EZSE: Checks if self contains a list of items.
    public func contains(_ items: Element...) -> Bool {
        return items.testAll { self.index(of: $0) ?? -1 >= 0 }
    }

    /// EZSE: Difference of self and the input arrays.

        }
        return result
    }
}

//MARK: - Deprecated 1.8

extension Array {

    /// EZSE: Checks if array contains at least 1 instance of the given object type
    @available(*, deprecated: 1.8, renamed: "containsType(of:)")
    public func containsInstanceOf<T>(_ element: T) -> Bool {
        return containsType(of: element)
    }

    /// EZSE: Gets the object at the specified index, if it exists.
    @available(*, deprecated: 1.8, renamed: "get(at:)")
    public func get(_ index: Int) -> Element? {
        return get(at: index)
    }

    /// EZSE: Checks if all elements in the array are true of false
    @available(*, deprecated: 1.8, renamed: "testAll(is:)")
    public func testIfAllIs(_ condition: Bool) -> Bool {
        return testAll(is: condition)
    }

}

extension Array where Element: Equatable {

    /// EZSE: Removes the first given object
    @available(*, deprecated: 1.8, renamed: "removeFirst(_:)")
    public mutating func removeFirstObject(_ object: Element) {
        removeFirst(object)
    }

    /// EZSE: Removes all occurrences of the given object
    @available(*, deprecated: 1.8, renamed: "removeAll(_:)")
    public mutating func removeObjects(_ objects: Element...) {
        objects.forEach { self.removeAll($0) }
    }

}

//MARK: - Deprecated 1.7

extension Array {

    /// EZSE: Iterates on each element of the array with its index. (Index, Element)
    @available(*, deprecated: 1.7, renamed: "forEachEnumerated(_:)")
    public func forEach(_ call: @escaping (Int, Element) -> ()) {
        forEachEnumerated(call)
    }

    /// EZSE: Prepends an object to the array.
    @available(*, deprecated: 1.7, renamed: "insertFirst(_:)")
    public mutating func insertAsFirst(_ newElement: Element) {
        insertFirst(newElement)
    }

}

extension Array where Element: Equatable {

    /// EZSE: Checks if the main array contains the parameter array
    @available(*, deprecated: 1.7, renamed: "contains(_:)")
    public func containsArray(_ array: [Element]) -> Bool {
        return contains(array)
    }

    /// EZSE: Returns the indexes of the object
    @available(*, deprecated: 1.7, renamed: "indexes(of:)")
    public func indexesOf(_ object: Element) -> [Int] {
        return indexes(of: object)
    }

    /// EZSE: Returns the last index of the object
    @available(*, deprecated: 1.7, renamed: "lastIndex(_:)")
    public func lastIndexOf(_ object: Element) -> Int? {
        return lastIndex(of: object)
    }

    /// EZSE: Removes the first given object
    @available(*, deprecated: 1.7, renamed: "removeFirstObject(_:)")
