     
     /// Triggered when user changes the jam colour slider
     @IBAction func jamSliderMoved(_ sender: UISlider) {
+        let colour = PerformerProfile.colourFromHue(hue: sender.value)
+        sender.tintColor = colour
+        sender.thumbTintColor = colour
+        if let profile = userProfile {
+            profile.jamColour = colour
+        }
     }
     
     /// Triggered when user changes the background colour
     @IBAction func backgroundSliderMoved(_ sender: UISlider) {
+        let colour = PerformerProfile.colourFromHue(hue: sender.value)
+        sender.tintColor = colour
+        sender.thumbTintColor = colour
+        if let profile = userProfile {
+            profile.backgroundColour = colour
+        }
+    }
+    
+    /// Update the User's stageName in CloudKit
+    private func updateUserStageName(_ userRecord: CKRecord, with stageName: String) {
+        userRecord[UserCloudKeys.stagename] = stageName as CKRecordValue
+        container.publicCloudDatabase.save(userRecord) { _, error in
+            if (error != nil) {
+                print("USVC: Error saving to cloudkit")
+                print(error ?? "")
+            } else {
+                print("USVC: updated user in cloudkit", stageName)
+            }
+        }
+    }
+    
+    /// Update basic profile info in CloudKit (stagename, colours, and soundscheme)
+    /// Does not update avatar image.
+    internal func updateUserBasicProfile(_ userRecord: CKRecord, with profile: PerformerProfile) {
+        userRecord[UserCloudKeys.stagename] = profile.stageName as CKRecordValue
+        userRecord[UserCloudKeys.jamColour] = profile.jamColour.hexString() as CKRecordValue
+        userRecord[UserCloudKeys.backgroundColour] = profile.backgroundColour.hexString() as CKRecordValue
+        userRecord[UserCloudKeys.soundScheme] = profile.soundScheme as CKRecordValue
+        
+        container.publicCloudDatabase.save(userRecord) { _, error in
+            if (error != nil) {
+                print("USVC: Error saving to cloudkit")
+                print(error ?? "")
+            } else {
+                print("USVC: updated user profile in cloudkit.")
+            }
+        }
+        
+        // update user defaults
+        // FIXME: use of userdefaults should be deprecated.
+        UserDefaults.standard.set(profile.stageName, forKey: SettingsKeys.performerKey)
+        UserDefaults.standard.set(PerformerProfile.hueFrom(colour: profile.jamColour), forKey: SettingsKeys.performerColourKey)
+        UserDefaults.standard.set(PerformerProfile.hueFrom(colour: profile.backgroundColour), forKey: SettingsKeys.backgroundColourKey)
+        UserDefaults.standard.set(profile.soundScheme, forKey: SettingsKeys.soundSchemeKey)
+    }
+    
+    override func viewWillDisappear(_ animated: Bool) {
+        print("USVC: view will disappear")
+        if let profile = userProfile, let record = userRecord {
+            updateUserBasicProfile(record, with: profile)
+        }
+    }
+    
+    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
+        // When segue occurs, request to upload basic profile info to CloudKit
+        print("USVC: preparing to segue")
     }
 }
 

    var userRecord: CKRecord? {
        didSet {
            if let userRecord = userRecord {
                if let avatar = userRecord["avatar"] as? CKAsset {
                    avatarImageView.image = UIImage(contentsOfFile: avatar.fileURL.path)
                }
                avatarContainerView.isHidden = false
            } else {
                avatarContainerView.isHidden = true
            }
        }
    }
    
    

            
            updateUserRecord(userRecord, with: url, fallbackImage: previousImage)
        } catch {
            print("USVC: Error writing avatar to temporary directory: \(error)")
        }
    }
    
    /// Update the user's avatar in CloudKit
    private func updateUserRecord(_ userRecord: CKRecord, with avatarURL: URL, fallbackImage: UIImage?) {
        avatarSpinner.startAnimating()
        avatarImageView.alpha = 0.5
        
        userRecord[UserCloudKeys.avatar] = CKAsset(fileURL: avatarURL)
        
        container.publicCloudDatabase.save(userRecord) { _, error in
            defer {
