To address these issues and to enable efficient optimization of molecular saddle points, our algorithm defines internal coordinates and replaces pathological linear bending angles with more well-defined coordinates. If necessary, our algorithm will add dummy atoms to the system automatically at the beginning of the optimization for the purpose of defining new coordinates to replace linear bending angles. Moreover, if previously well-defined bending angles become linear mid-optimization, our algorithm will automatically replace those coordinates without interrupting the optimization procedure. This resolves the common problem of initially well-defined coordinate systems becoming invalid partway through optimization, resulting in a crash or other error.