 "turn on 522,730 through 968,950\n" +
 "turn off 102,229 through 674,529"
 
-var lights: [Int] = Array(count: 1000*1000, repeatedValue: 0)
-
-enum Action {
+private var lights: [Int] = Array(count: 1000*1000, repeatedValue: 0)
+private var brightness: [Int] = Array(count: 1000*1000, repeatedValue: 0)
+
+private enum Action {
     case None
     case TurnOn
     case TurnOff
     case Toggle
 }
 
-struct Instruction {
+private struct Instruction {
     let startPoint: CGPoint
     let endPoint: CGPoint
     let action: Action

    switch action {
    case .TurnOn:
        lights[index] = 1
    case .TurnOff:
        lights[index] = 0
    case .Toggle:
        lights[index] = (lights[index] + 1) % 2
    case .None:
        print("Reached .None case")
    }

        return Instruction.init(start: data.start, end: data.end, input: data.action)
    }
    
    performInstructions(instructions)
    let numLitLights = sumElements(lights)
    let combinedBrightness = sumElements(brightness.filter{ $0 > 0 })
    
    print("there are \(numLitLights) lit lights, with combined brightness of \(combinedBrightness)")
    return numLitLights
}
