changing to the new specifications for bw.select and resid.type