uses slice buffers instead of arrays