That is where I started, but it causes: `runtime error: invalid memory address or nil pointer dereference`

This, admittedly inelegant, variable swap was the only way I could find to get it to work.