         self.computeCommandEncoder?.setComputePipelineState(OSBaseFrame.metalComputePipelineState!);
         
         //pass the data to GPU
-        let dataSize : Int = self.notCalibratedDepth.count//self.height * self.width;
+        let dataSize : Int = self.notCalibratedDepth!.count//self.height * self.width;
 
         let inputByteLength = dataSize * sizeof(Float);
         let inVectorBuffer = OSBaseFrame.device.newBufferWithBytes(&self.notCalibratedDepth, length: inputByteLength, options:[]);

    private var commandBuffer : MTLCommandBuffer?;
    private var computeCommandEncoder : MTLComputeCommandEncoder?;
    
    private func prepareMetalForSurgery()
    {
        let startTime = CACurrentMediaTime();
        

        self.computeCommandEncoder?.setBuffer(outputBuffer, offset: 0, atIndex: 1);
        self.computeCommandEncoder?.setBuffer(OSBaseFrame.calibrationMatrixBuffer, offset: 0, atIndex: 2);
        
        //prepare thread groups
        let threadGroupCountX = dataSize / 512;
        let threadGroupCount = MTLSize(width: threadGroupCountX, height: 1, depth: 1)
        let threadGroups = MTLSize(width:(dataSize + threadGroupCountX - 1) / threadGroupCountX, height:1, depth:1);
