add bwt function.