         let file = fileUrl(name: fileName)
         
         // all styles for this wokrbook
-        var styles = [String]()
+        var styles = [String : String]() // id : value
         
         // adds new style, returns it's ID
         let appendStyle: (String)->String = {
             let id = "s\(styles.count)"
-            styles.append("<Style ss:ID=\"\(id)\">\($0)</Style>")
+            styles[id] = "<Style ss:ID=\"\(id)\">\($0)</Style>"
             return id
         }
         

            case .color(let c): return "ss:Color=\"\(c.hexString())\""
            }
        }
    }
    
    case backgroundColor(Color)

        let workbookLead = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><?mso-application progid=\"Excel.Sheet\"?><Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\" xmlns:html=\"http://www.w3.org/TR/REC-html40\">"
        let workbookTrail = "</Workbook>"
        
        let stylesValue = "<Styles>\(styles.values.joined())</Styles>"
        
        let content = [workbookLead, stylesValue, sheetsValues.joined(), workbookTrail].joined()
        let totalRows = sheets.flatMap{ $0.rows }.count
