vectorize %bw%