Five-axes machines with three translational and two rotation axes are becoming increasingly popular in serving the needs of the mass production industry due to their ability to handle geometrically complex workpieces using the rotational axes. The rotation axes lead to an inevitable non-linearity of the tool tip trajectory and the so-called kinematics errors appearing due to the specific kinematics of the machine. An interesting question is whether it is possible to compensate this error by introducing an additional rotation axis. We present an extension of an optimization algorithm developed earlier by the authors for five-axis machining based on an optimal angle sequencing (the shortest path optimization). The extension is a combination of the shortest path strategy and the use of the additional axis. The method to calculate post processor for the six-axes machine is included.