Using Mathematics to Combat Gerrymandering