 
 extension YapDatabaseConnection {
 
+    /**
+    Synchronously reads from the database on the connection. The closure receives
+    the read transaction, and the function returns the result of the closure. This
+    makes it very suitable as a building block for more functional methods.
+    
+    The majority of the wrapped functions provided by these extensions use this as 
+    their basis.
+
+    :param: block A closure which receives YapDatabaseReadTransaction and returns T
+    :returns: An instance of T
+    */
     public func read<T>(block: (YapDatabaseReadTransaction) -> T) -> T {
         var result: T! = .None
-        readWithBlock { transaction in
-            result = block(transaction)
-        }
+        readWithBlock { result = block($0) }
         return result
     }
 
+    /**
+    Synchronously writes to the database on the connection. The closure receives
+    the read write transaction, and the function returns the result of the closure.
+    This makes it very suitable as a building block for more functional methods.
+
+    The majority of the wrapped functions provided by these extensions use this as
+    their basis.
+
+    :param: block A closure which receives YapDatabaseReadWriteTransaction and returns T
+    :returns: An instance of T
+    */
     public func write<T>(block: (YapDatabaseReadWriteTransaction) -> T) -> T {
         var result: T! = .None
-        readWriteWithBlock { transaction in
-            result = block(transaction)
-        }
+        readWriteWithBlock { result = block($0) }
         return result
     }
 
+    /**
+    Asynchronously reads from the database on the connection. The closure receives
+    the read transaction, and completion block receives the result of the closure.
+    This makes it very suitable as a building block for more functional methods.
+
+    The majority of the wrapped functions provided by these extensions use this as
+    their basis.
+
+    :param: block A closure which receives YapDatabaseReadTransaction and returns T
+    :param: queue A dispatch_queue_t, defaults to main queue, can be ommitted in most cases.
+    :param: completion A closure which receives T and returns Void.
+    */
     public func asyncRead<T>(block: (YapDatabaseReadTransaction) -> T, queue: dispatch_queue_t = dispatch_get_main_queue(), completion: (T) -> Void) {
         var result: T! = .None
-        asyncReadWithBlock({ transaction in result = block(transaction) }, completionQueue: queue) { completion(result) }
-    }
-}
-
-
+        asyncReadWithBlock({ result = block($0) }, completionQueue: queue) { completion(result) }
+    }
+
+    /**
+    Asynchronously writes to the database on the connection. The closure receives
+    the read write transaction, and completion block receives the result of the closure.
+    This makes it very suitable as a building block for more functional methods.
+
+    The majority of the wrapped functions provided by these extensions use this as
+    their basis.
+
+    :param: block A closure which receives YapDatabaseReadWriteTransaction and returns T
+    :param: queue A dispatch_queue_t, defaults to main queue, can be ommitted in most cases.
+    :param: completion A closure which receives T and returns Void.
+    */
+    public func asyncWrite<T>(block: (YapDatabaseReadWriteTransaction) -> T, queue: dispatch_queue_t = dispatch_get_main_queue(), completion: (T) -> Void) {
+        var result: T! = .None
+        asyncReadWriteWithBlock({ result = block($0) }, completionQueue: queue) { completion(result) }
+    }
+}
+
+

    /**

    A database index value type.
    
    :param: collection A String
    :param: key A String
    */


import YapDatabase

/**

This is an empty struct used as a namespace for new types to
