How gerrymandering gave GOP crucial edge in swing states