How can I check if an index of a 2d array is out of bounds? - C#