Major indexes close out quarter with solid gains