Complex sentence: Among others, both actions were meant to test the spacecraft's instruments while the probe needed the gravity of Mars to change directions in order to undertake its second Earth flyby in November.
Split into simpler sentences: Among others, both actions were meant to test the spacecraft's instruments. The space craft used the gravity of Mars to change course towards its second Earth flyby in November.