adding d variable