Modernizing double loops in C#? - C#