created conversion between row,column pair and index so getting the square from row, column pari can be done faster.