         } else {
             keysHeld.removeAll()
             midiNotesHeld.removeAll()
+        }
+    }
+    
+    func updateKeyToUpPosition(key: UIButton) {
+        let index = key.tag - 200
+        if blackKeys.contains(index) {
+            key.setImage(UIImage(named: "blackkey"), forState: .Normal)
+        } else {
+            key.setImage(UIImage(named: "whitekey"), forState: .Normal)
+        }
+    }
+    
+    func updateKeyToDownPosition(key: UIButton) {
+        let index = key.tag - 200
+        if blackKeys.contains(index) {
+            key.setImage(UIImage(named: "blackkey_selected"), forState: .Normal)
+        } else {
+            key.setImage(UIImage(named: "whitekey_selected"), forState: .Normal)
         }
     }
     

                    return
                }
                
                let index = keyTag - 200
                if blackKeys.contains(index) {
                    key.setImage(UIImage(named: "blackkey_selected"), forState: .Normal)
                } else {
                    key.setImage(UIImage(named: "whitekey_selected"), forState: .Normal)
                }

            }
        }
    }

    // *********************************************************
    
    func turnOnKey(key: UIButton) {
        updateKeyToDownPosition(key)
        let midiNote = midiNoteFromTag(key.tag)
        statusLabel.text = "Key Pressed: \(noteNameFromMidiNote(midiNote))"
        conductor.core.playNote(midiNote, velocity: 127)
     
    }
    
    func turnOffKey(key: UIButton) {
        updateKeyToUpPosition(key)
        statusLabel.text = "Key Released"
        conductor.core.stopNote(midiNoteFromTag(key.tag))
    }
    
    func turnOffHeldKeys() {
        updateAllKeysToUpPosition()
        
        for note in midiNotesHeld {
            conductor.core.stopNote(note)
        }
    
        statusLabel.text = "Key(s) Released"
        keysHeld.removeAll(keepCapacity: false)
        midiNotesHeld.removeAll(keepCapacity: false)
    }
    
    func updateAllKeysToUpPosition() {
        // turn off all keys on display
        for tag in 248...272 {
            guard let key = self.view.viewWithTag(tag) as? UIButton else {
                return
            }
            updateKeyToUpPosition(key)
        }
    }
    
    func redisplayHeldKeys() {
        
        // Refresh keyboard
        updateAllKeysToUpPosition()
        
        // Determine new keyboard bounds
        let lowerMidiNote = 48  + (keyboardOctavePosition * 12)
        let upperMidiNote = lowerMidiNote + 24
        statusLabel.text = "Keyboard Shift: \(noteNameFromMidiNote(lowerMidiNote)) to \(noteNameFromMidiNote(upperMidiNote))"
