Why did Elbridge Gerry of Massachusetts redraw the congressional districts in his state?

ATo get a president elected
BTo give each major party fair representation
CTo give his party unfair political advantage
DTo get elected to the Senate