Legality and Discretion in the Distribution of Criminal Sanctions