 public class SQPool {
     
     private let path: String?
-    private let flags = SQDatabase.Flags.ReadWriteCreate
-    private var useID = 0
-    private var connPool: [SQDatabase] = []
+    private var connIndex = 1
+    private let flags = SQDatabase.Flag.ReadWriteCreate
+    private var connPool: [Int:SQDatabase] = [:]
     private var inUsePool: [Int:SQDatabase] = [:]
     
     // Queue for database write operations

        return queue
    }()
    // Queue for getting/releasing databases in pool
    private lazy var poolQueue: dispatch_queue_t = {
        [unowned self] in
        var queue = dispatch_queue_create("swiftdata.pool.conn.\(self)", DISPATCH_QUEUE_SERIAL)
        return queue
        }()
    
    public var maxSustainedConnections = 5
    
    public init() {

        return status
    }
    
    public func transactionAsync(closure: (SQDatabase)->Bool) {
        dispatch_async(dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0), {let suc = self.transaction(closure)})
    }
    
    public func write(closure: (SQDatabase)->Void) {
        let (index, db) = getConnection()
        dispatch_sync(writeQueue, {
