US stock markets close with gains again. Best week since October 2023