     - parameter database:    The database, ex: 'test'
     - parameter userAndPass: The username and password for the user in the format (username, password) - optional.
     */
-    public init(host: String, port: Int, database: String, usernameAndPassword userAndPass:(String,String)? = nil) {
+    public init(host: String, port: Int, database: String, usernameAndPassword userAndPass:(username: String, password: String)? = nil) {
         
         mongo_init(self.connection!)
 
+        let status = mongo_client(self.connection!, host, Int32(port))
 
-        let status = mongo_client(self.connection!, host, Int32(port))
-        
         if status != MONGO_OK {
             print("connection failed")
             mongo_destroy(self.connection!)


        self.collections.insert(collection)
    }
}

    
    internal var connection: UnsafeMutablePointer<mongo>? = mongo_alloc()

    internal var databaseName: String
    
    public var db: String { // read only
        get {
            return self.databaseName
        }
    }
    
    public func changeDB(databaseName: String) {
        self.databaseName = databaseName
    }

    internal var collections = Set<MongoCollection>()
    

