Ideal code, real world : a rule-consequentialist theory of morality