Abstract We have written a new computer program for diagonalizing the nonrigid bender Hamiltonian, and have based the program entirely on the theory as reviewed by P. Jensen [ Comp. Phys. Rep. 1, 1–56 (1983)] and P. Jensen and P. R. Bunker [ J. Mol. Spectrosc. 118, 18–39 (1986)]. Using this program we can calculate the rotation-vibration energy levels of a triatomic molecule from the potential energy function. The program is an improvement over an earlier version, particularly in the systematic treatment of all singular terms, and in the allowance made for the dependence of all perturbation energy denominators on the bending quantum number v 2 and rotation quantum number K . The new program can be used for symmetric and unsymmetric triatomic molecules. In the present paper we test the program by applying it to the calculation of the rotation-vibration energy levels of C 3 from an ab initio potential surface, and of H 2 O from ab initio and experimental potential surfaces.