I'd rename this ```copy_scalar_coords``` and move it down to where it's used near line 1209.