now using 2D arrays