Cost of equity

Can someone please lay out the intermediate step to achieve this end-result formula: ra = rd(D/V) + re(E/V) where ra= weighted average cost of capital rd= cost of debt re= cost of equity (D/V) and (E/V) = debt weight and equity weight re-arranging; re = ra + (ra - rd)(D/E) Can you please clarify what happens in between the first formula above and the end formula?

ra = rd (d/v) + re (e/v) and v = d + e ra = [rd * d + re * e] / (d+e) since v = d+e ra * (d+e) / e = rd * d/e + re or ra * (1+d/e) = rd * d/e + re or re = ra + [ra-rd] (D/e)

Thanks