One month after Time Warner Cable rejected a takeover bid as “grossly inadequate,” the nation’s second-largest cable company has attracted a better offer from a bigger buyer.

In a transaction officially announced last week, Time Warner has agreed to be purchased by Comcast, the country’s leading cable provider. The all-stock deal is valued at about $45 billion, or roughly $67 billion when assumed debt is tacked on.