fixed macro for element addressing in grid and flat two dimensional arrays