         if !permissionGranted {
             print("Permission to record not granted")
             throw NSError(domain: NSURLErrorDomain, code: NSURLErrorUnknown, userInfo: nil)
-        } else  {
+        } else {
             print("Permission to record granted ! ")
         }
 


        recording = true

        node.avAudioNode.installTapOnBus(0, bufferSize: bufferSize, format: tape.processingFormat, block:
            { (buffer: AVAudioPCMBuffer!, time: AVAudioTime!) -> Void in
                do{
                    try self.tape.writeFromBuffer(buffer)
                    print("writing ( file duration:  \(self.tape.duration) seconds)")
                }
                catch let error as NSError{
                    print("Write failed: error -> \(error.localizedDescription)")
                }
        })

    
    // MARK: - public vars
    // True if we are recording.
    public var isRecording: Bool {
        return recording
    }
}
