When Does Gerrymandering Become Illegal