*Really* correct "dw" function