     
     //T.ODO removeSavely - using findUnique
     
-    mutating func remove(key key: Element) throws -> Element {
+    mutating func remove(key key: K) throws -> (key: K, value: V) {
         return try executeForKey(key) {
             b, i in
                 if i != nil { return self.table[b].removeAtIndex(i!) }

    
    func sort() {
        for arr in table {
            arr.sort { return $0.hashValue < $1.hashValue }
        }
    }
    
    var array : [Element] {
        var array = [Element]()
        for arr in table {
            for v in arr {
                array.append(v)
            }
        }
        return array

    
    //F.IX needs mathematical basis
    mutating func correctBucketCount() throws {
        print("tries correction")
        var quotient = (count / table.count) >> 4
        while quotient > 0 {
            try changeBucketCount(table.count << 1)
            quotient = (count / table.count) >> 0x10
        }
    }
    
    func hash(key: K) throws -> Int {
        return ((hashFunction(key) + table.count) % table.count)
    }
    
    internal mutating func changeBucketCount(buckets: Int) throws {
        try changeBucketCount(buckets, f: hashFunction)
    }
    
    internal mutating func changeBucketCount(buckets: Int, f: K -> Int) throws {
        let oldHash = self.hashFunction
        let oldTable = self.table
        do {
            self.hashFunction = f
            self.table = [[(key: K, value: V)]](count: buckets, repeatedValue: [])
            for bucket in oldTable {
                for element in bucket {
                    try insertNoCorrection(element: element)
