         return daysInfo
     }
     
-    func rectForDay(offset:Int, rowIndex:Int, canvasHeight:Int) -> Rect? {
-        
-        let COL_WIDTH = Constants.COL_WIDTH
-        let ROW_HEIGHT = Constants.ROW_HEIGHT
-        let LEFT_MARGIN_WIDTH = Constants.LEFT_MARGIN_WIDTH
-        let TOP_MARGIN_HEIGTH = Constants.TOP_MARGIN_HEIGTH
+    func rectForDay(offset:Int, rowIndex:Int, canvasHeight:Int) -> Rect {
+        
+        let COL_WIDTH = self.COL_WIDTH
+        let ROW_HEIGHT = self.ROW_HEIGHT
+        let LEFT_MARGIN_WIDTH = self.LEFT_MARGIN_WIDTH
+        let TOP_MARGIN_HEIGTH = self.TOP_MARGIN_HEIGTH
         
         let p = P(
             LEFT_MARGIN_WIDTH + offset,

            daysInfo[day] = (weekDay, offset)
            
            let isDayOff = (weekDay == 1 || weekDay == 2)
            offset += isDayOff ? 2 : Constants.COL_WIDTH
            
            if existingDate.compare(toDate) != NSComparisonResult.OrderedAscending {
                stop.memory = true


import Cocoa

infix operator +=? { associativity right precedence 90 }
func +=? (inout left: Int, right: Int?) {
    if let existingRight = right {
        left = left + existingRight
    }
}

struct Chart {
    
    let COL_WIDTH = 20
    let ROW_HEIGHT = 20
    let LEFT_MARGIN_WIDTH = 20
    let TOP_MARGIN_HEIGTH = 100
    
    let weekDaysToSkip = [1,2] // Saturday, Sunday
    
    var dateFormatter: NSDateFormatter = {
        let df = NSDateFormatter()
