pass in buffer width