LINQ instead of an For each and IF