Using redundant internal coordinates to optimize equilibrium geometries and transition states