How to make GPU instancing code work?

i was trying gpu instancing and i ran into a roadblock. heres the code i wrote:

public class Connector : MonoBehaviour
{
    public int instances;
    public Material[] materials;
    public Mesh mesh;
    public Vector3 position, rotation, scale;
    private List<List<Matrix4x4>> batches = new List<List<Matrix4x4>>();

    private void RenderBatches()
    {
        foreach (var Batch:List<Matrix4x4> in batches) 
        {
            //stuff that i want to do
        }
    }
}

but it shows a whole bunch of errors
how to make this code work, but have the same functionality: for each List in batches?

GPU Instancing for GameObjects ยท GitHub

Thanks for the comment! it really helped.