the amount should be the minimum of wanted and available.