             throw error
         }
     }
-    
     
     func writeManifest() throws {
         let at = "./Contents/Chapters/\(chapterName).playgroundchapter/Pages/\(name).playgroundpage/"

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

    }
    
    mutating func add(chapter: Chapter) throws {
        if chapters.map({$0.name}).index(of: chapter.name) != nil {
            throw NSError.error(description: "Already page has been added.")
        }
        chapters.append(chapter)
        do {
            try writeManifest()
