copy of old dhw functions