changed z to d