improved wdi convert script