For the computation of excited states, the traditional solutions of the Schredinger equation, using higher roots of a secular equation in a finite N-dimensional function space, by the Hylleraas-Undheim and MacDonald (HUM) theorem, we found that it has several restrictions which render it of lower quality, relative to the lowest root if the latter is good enough. In order to avoid the variational restrictions, based on HUM, we propose a new variational function and prove that the trial wave function has a local minimum in the eigenstates, which allows to approach eigenstates unlimitedly by variation. In this paper, under the configuration interaction (CI), we write a set of calculation programs by using generalized laguerre type orbitals (GLTO) to get the approximate wave function of different states, which is base on the HUM or the new variational function. By using the above program we get the approximate wave function for 1S (e), 1P (o) state of helium atoms (He) through the different theorems, the energy value and radial expectation value of related states. By comparing with the best results in the literature, the theoretical calculations show the HUM's defects and the new variational function's superiority, and we further give the direction of improving the accuracy of excited states.