Provided further, That in addition to the powers conferred upon the viewers by this act, they are hereby authorized and shall assess the cost of such widening and altering, or either widening or altering, of such road to the respective cities and boroughs, or city and borough and townships, or township as the case may be, in such proportion as to them may seem equitable and just, taking into consideration benefits derived by such widening and altering, or either widening or altering, to the cities or boroughs, or city and borough and townships, or township, connected by and through which said such road may pass; and in case such widening or altering, or either, is made necessary in part by the use of such road by a corporation, or corporations, then the viewers shall have further power to assess such corporation, or corporations, such part of the cost of widening and altering, or either, as the viewers may agree is just and reasonable.
36 P.S. § 2053