Modified test-bw.sh to use arrays and a for loop instead.