update bwt code