 
 public class PIImageCache {
   
+  //initialize
+  
   private func myInit() {
     folderCreate()
     prefetchQueueInit()

      }
    }
    return nil
  }
  
  internal enum Result {
    case Mishit, MemoryHit, DiskHit
  }
  
  internal func perform(url: NSURL) -> (UIImage?, Result) {

    dispatch_semaphore_signal(memorySemaphore)
  }
  
  //public download method
  
  public func get(url: NSURL) -> UIImage? {
    return perform(url).0
  }
  
  public func get(url: NSURL, then: (image:UIImage?) -> Void) {
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
      [weak self] in
      if let scope = self {
        dispatch_async(dispatch_get_main_queue()) {
          then(image: scope.get(url))
        }
      }
    }
  }
  
  public func prefetch(urls: [NSURL]) {
    for url in urls {
      prefetch(url)
    }
  }
  
  public func prefetch(url: NSURL) {
    var op = NSOperation()
    op.completionBlock = {
      [weak self] in
      self?.downloadToDisk(url)
    }
    prefetchQueue.addOperation(op)
  }
  
  //public delete method
  
  public func allMemoryCacheDelete() {
    dispatch_semaphore_wait(memorySemaphore, DISPATCH_TIME_FOREVER)
    memoryCache.removeAll(keepCapacity: false)
    dispatch_semaphore_signal(memorySemaphore)
  }
  
  public func allDiskCacheDelete() {
