     return (0..<8)
             .filter { current.fits(x: $0, y: y) }
             .reduce([]) { results, x in
-                var current = current
-                current.append(Queen(x: x, y: y))
-                var results = results
-                results.append(contentsOf: boards(basedOn: current, y: y + 1))
-                return results
+                let current = current + [Queen(x: x, y: y) as ChessPiece]
+                return results + boards(basedOn: current, y: y + 1)
             }
     
 }

    func prettyPrint() {
        let string = coordinates.reduce("") { board, row in
            return board + row.reduce("") { row, item in
                return row + "| \(self.representation(x: item.0, y: item.1)) "
            } + "| \r\n"
        }
        print(string)
    }

    }
    
    func canAttack(x: Int, y: Int) -> Bool {
        return self.x == x || self.y == y || abs(self.x - x) == abs(self.y - y)
    }
}

