implement d_beta