In this paper, we analyse a new exponential-type integrator for the nonlinear cubic Schrodinger equation on the $d$ dimensional torus $mathbb T^d$. The scheme has recently also been derived in a wider context of decorated trees in [Y. Bruned and K. Schratz, arXiv:2005.01649]. It is explicit and efficient to implement. Here, we present an alternative derivation, and we give a rigorous error analysis. In particular, we prove second-order convergence in $H^gamma(mathbb T^d)$ for initial data in $H^{gamma+2}(mathbb T^d)$ for any $gamma > d/2$. This improves the previous work in [Knoller, A. Ostermann, and K. Schratz, SIAM J. Numer. Anal. 57 (2019), 1967-1986]. The design of the scheme is based on a new method to approximate the nonlinear frequency interaction. This allows us to deal with the complex resonance structure in arbitrary dimensions. Numerical experiments that are in line with the theoretical result complement this work.