Trying to find devices in script for VR Controllers but have compiler errors I don't understand

Hello, following along with a tutorial and I am getting errors that I do not understand and that are not present in the tutorial.
My code is:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR;
public class Handpresence : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {}
        private InputDevice targetDevice;
        List<InputDevice> devices = new List<InputDevice>();
        InputDeviceCharacteristics rightControllerCharacteristics = InputDeviceCharacteristics.Right | InputDeviceCharacteristics.Controller;
        InputDevices.GetDevicesWithCharacteristics(rightControllerCharacteristics, devices);

        foreach (var item in devices)
        {
        Debug.Log(item.name + item.characteristics);
        }

        if(devices.Count > 0)
        {
            targetDevice = devices[0];
        }
    }

    // Update is called once per frame
    void Update()
    {
        targetDevice.TryGetFeatureValue(CommonUsages.primaryButton, out bool primaryButtonValue);
        if (primaryButtonValue)
            Debug.Log("Pressing Primary Button");
    }
}

I have 22 compiler errors that are posted here.



Line 9 is never going to be right like that… braces define the entire function.

Also line 10 has the keyword private which means it must be a member variable, not a local variable.

Spelling, capitalization and especially punctuation must be 100% correct in code. Not even 99.9% is good enough… it has to be 100%.