An optimized algebraic basis for molecular potentials