Changing base math to utilize 2d array