The roles of retribution and utility in determining punishment