         
         // If new value is invalid then only g is set.
         if value < 0 || value >= 16 {
-            gSegment.state = true
+            fSegment.state = true
         } else {
-            bSegment.state = true
-            cSegment.state = true
+            gSegment.state = gState > 0
         }
     }
     

    func display(value: Int) {
        
        let v = UInt8(value)
        print(String(v << 4, radix: 2).pad(with: "0", length: 4))
        
        // Turn off all segments to prepare for new value.
        _ = segments?.map({

        super.viewDidLoad()

        // Do any additional setup after loading the view.
        display(value: 14/2)
    }

    override func viewDidAppear(_ animated: Bool) {
