Upon hearing being held, if no valid objections are interposed to said sale, and if it shall appear to the court that said sale should be made according to its terms, the court shall order the county commissioners to make and deliver to the purchaser a commissioners' deed for the proper conveying of said lands, and to collect the purchase price therefor and the proceeds realized from said sale shall be distributed to the payment of first, the costs of sale; second, all moneys expended by the county in the demolition, removal or repair of any building or structure on such property after the same had been condemned as unsafe by the political subdivision in which the same is located; third, all moneys expended by the county on order of the Pennsylvania State Police, or an assistant to the Pennsylvania State Police, in removing or remedying any condition on such property that is found to be a fire menace or hazard; and fourth, taxes due the various taxing authorities in proportion to their respective interests.
72 P.S. § 5970c