fix bug in W adjustment and visualization