switched from switch statement to 2d array