Improved bounds for Stein's square functions