     Dispatches a compute kernel on a 2-dimensional grid.
     
     - Parameters:
-      - rows: the first dimension
-      - columns: the second dimension
-  */
-  public func dispatch(pipeline: MTLComputePipelineState, rows: Int, columns: Int) {
-    let h = pipeline.threadExecutionWidth
-    let w = pipeline.maxTotalThreadsPerThreadgroup / h
+      - width: the first dimension
+      - height: the second dimension
+  */
+  public func dispatch(pipeline: MTLComputePipelineState, width: Int, height: Int) {
+    let w = pipeline.threadExecutionWidth
+    let h = pipeline.maxTotalThreadsPerThreadgroup / w
 
     let threadGroupSize = MTLSizeMake(w, h, 1)
 
     let threadGroups = MTLSizeMake(
-      (rows    + threadGroupSize.width  - 1) / threadGroupSize.width,
-      (columns + threadGroupSize.height - 1) / threadGroupSize.height, 1)
+      (width  + threadGroupSize.width  - 1) / threadGroupSize.width,
+      (height + threadGroupSize.height - 1) / threadGroupSize.height, 1)
 
     setComputePipelineState(pipeline)
     dispatchThreadgroups(threadGroups, threadsPerThreadgroup: threadGroupSize)

      (height + threadGroupSize.height - 1) / threadGroupSize.height,
      (slices + threadGroupSize.depth  - 1) / threadGroupSize.depth)

    //printGrid(threadGroups, threadGroupSize)

    setComputePipelineState(pipeline)
    dispatchThreadgroups(threadGroups, threadsPerThreadgroup: threadGroupSize)
  }

  func printGrid(_ threadGroups: MTLSize, _ threadGroupSize: MTLSize) {
    let grid = MTLSizeMake(threadGroups.width  * threadGroupSize.width,
                           threadGroups.height * threadGroupSize.height,
                           threadGroups.depth  * threadGroupSize.depth)

    print("threadGroups: \(threadGroups.width)x\(threadGroups.height)x\(threadGroups.depth)"
        + ", threadsPerGroup: \(threadGroupSize.width)x\(threadGroupSize.height)x\(threadGroupSize.depth)"
        + ", grid: \(grid.width)x\(grid.height)x\(grid.depth)")
  }


}

/**
  Helper function that creates a pipeline for a compute kernel.
*/
public func makeFunction(device: MTLDevice, name: String,
                         constantValues: MTLFunctionConstantValues? = nil,
