         }
     }
     
+    func parepareDefaultFiles() throws {
+        let path = "./\(name).playgroundbook"
+        let sourcesPath = "./\(path)/Contents/Sources"
+        let resourcesPath = "./\(path)/Contents/Resources"
+        do {
+            try FileManager.default().createDirectory(atPath: sourcesPath, withIntermediateDirectories: true, attributes: nil)
+            try FileManager.default().createDirectory(atPath: resourcesPath, withIntermediateDirectories: true, attributes: nil)
+        } catch {
+            throw error
+        }
+    }
+    
     func create() throws {
         // create book
         do {

            let contentsPath = "./\(path)/Contents"
            try FileManager.default().createDirectory(atPath: contentsPath, withIntermediateDirectories: true, attributes: nil)
            try writeManifest(at: "./\(path)/Contents/Manifest.plist")
        } catch {
            throw error
        }

    var pages: [Page]
    let version: String
    
    init(name aName: String, version aVersion: String = "1.0") {
        print("Chapter name = \(aName)")
        name = aName
        version = aVersion
        pages = []
        
        let at = "./Contents/Chapters/\(name).playgroundchapter"
        let chapterManifestPath = "\(at)/Manifest.plist"
        if FileManager.default().isReadableFile(atPath: chapterManifestPath) {
            if let dict = NSDictionary(contentsOfFile: chapterManifestPath) {
                if let name = dict["Name"] as? String,
                    version = dict["Version"] as? String {
                    let pageNames = dict["Pages"] as? [String] ?? [] as [String]
                    
                    pages = pageNames.map({ (name) -> Page in
                        let title = name.replacingOccurrences(of: ".playgroundpage", with: "")
                        return Page(name: title, chapterName: name)
                    })
                }
            }
        }
    }

    func manifest() -> [String:AnyObject] {
