             -1.0,   1.0,  1.0, 0.0,
             1.0,  -1.0,  0.0, 1.0,
             -1.0,   1.0,  1.0, 0.0,
-            1.0,   1.0,  1.0, 1.0]
+            1.0,   1.0,  1.0, 1.0
+        ]
         
         // set up vertex buffer
         let dataSize = data.count * sizeofValue(data[0]) // 1
-        
-        var options:MTLResourceOptions!
-        
-        options = MTLResourceOptions.StorageModeShared.union(MTLResourceOptions.CPUCacheModeDefaultCache)
-        
-        _vertexBuffer = _device!.newBufferWithBytes(data, length: dataSize, options: options)
+        let options = MTLResourceOptions.StorageModeShared.union(MTLResourceOptions.CPUCacheModeDefaultCache)
+        _vertexBuffer = device.newBufferWithBytes(data, length: dataSize, options: options)
 
         // set vertex indicies start for each rotation
         _vertexStart[.LandscapeRight] = 0

import CoreVideo
import Metal
import MetalKit
import AVFoundation
import UIKit


            swapTextures()
            
        }
        
    }
    
