Ab initio calculations with a nonspherical Gaussian basis set : Excited states of the hydrogen molecule