Replace LINQ usage with a for loop.