modify code for unit reg buffers