bn: preallocate arrays