Use linq instead of foreach for discount calculation