private int getValueAt(int x, int y) { // refactor this use either case or a div/mod soln return state[getAbsPosition(x, y)]; }