batch subtraction

I am trying to subtract background out of several spectra. I currently have a 1d wave for the background and would like to subtract it from a 2d wave with n entries. My first attempt is below, any help is greatly appreciated. I could include sample waves if needed.

Macro bckgndsub()
// subtract background from n slices from spinsight NMR data file
variable n = 0;

do
backgndsub[][n] = spectrum[][n] - background;
n = n + 1;
while (n < DimSize(spectrum, 1));

endmacro