         //-----------------------------------------------------------
         let PositionDescriptor = MTLVertexAttributeDescriptor()
             PositionDescriptor.format = MTLVertexFormat.Float2
-            PositionDescriptor.offset = 0      // offsetof(VertexData, position)
+            PositionDescriptor.offset = 0      // offsetof(PointData, position)
             PositionDescriptor.bufferIndex = 0
 
         //-----------------------------------------------------------

        //-----------------------------------------------------------
        let TexCoordDescriptor = MTLVertexAttributeDescriptor()
        TexCoordDescriptor.format = MTLVertexFormat.Float2
        TexCoordDescriptor.offset = sizeof(V2f)  // offsetof(VertexData, texCoord)
        TexCoordDescriptor.bufferIndex = 0
        //
        //-----------------------------------------------------------
        // Layout descriptor for Vertex Data.
        //-----------------------------------------------------------
        let LayoutDescriptor = MTLVertexBufferLayoutDescriptor()
        LayoutDescriptor.stride = sizeof(VertexData)
        LayoutDescriptor.stepFunction = MTLVertexStepFunction.PerVertex
        LayoutDescriptor.stepRate = 1
        //

        //-----------------------------------------------------------
        // vertex descriptor for Rect.
        //-----------------------------------------------------------
        let RectDescriptor = MTLVertexDescriptor()
        RectDescriptor.attributes[0] = PositionDescriptor

            ColourPipelineDescriptor.fragmentFunction = fragmentProgram
            ColourPipelineDescriptor.vertexDescriptor = RectDescriptor

		var pipeline_err:NSError?
        self.colourPipeline = device!.newRenderPipelineStateWithDescriptor(
            ColourPipelineDescriptor, error: &pipeline_err)

        if (colourPipeline == nil)
        {
            println("colourPipeline")
        }
        if (pipeline_err != nil)
        {
            println("pipeline_err = \(pipeline_err)")
        }
        //-----------------------------------------------------------
        // compute pipeline state.
        //-----------------------------------------------------------
        var pipeline_error:NSError?
        let computeFunction = defaultLibrary!.newFunctionWithName("CheckerKernel")
        self.checkerPipeline = device!.newComputePipelineStateWithFunction(
              computeFunction!, error:&pipeline_error)

        if (checkerPipeline == nil)
        {
            println("checkerPipeline")
        }
        if (pipeline_error != nil)
        {
            println("pipeline_error = \(pipeline_error)")
        }
        //-----------------------------------------------------------
        // fill in BufferData.
