The CMG control program was responsible for making sure that the gimbals never hit the stops, by redistributing angular momentum between the three rotors to bring large gimbal angles closer to zero. Since the total angular momentum to be stored had only three degrees of freedom, while the control program could change six independent variables (the three pairs of gimbal angles), the program had sufficient freedom of action to do this while still obeying other constraints such as avoiding anti-parallel alignments.