I have a global variable where It keeps track of 2d matrix coordinates of a elements in a variable row and column In the main function. I called it by
global