protected static boolean eligibleLivingThingsMove(short[][][] maze, int x, int y, int newX, int newY) {

        try { //out of maze check
            int i = maze[newX][newY][0];
        } catch (ArrayIndexOutOfBoundsException e) {
            return false;
        }
        // Wall check 1111 last four digits: up, right, down, left
       if (newX == x + 1) { //move down
            if (digit(maze[x][y][0], 2) == 1) {
                return false;
            }
        } else if (newX == x - 1) { //move up
            if (digit(maze[x][y][0], 4) == 1) {
                return false;
            }
        } else if (newY == y + 1) {//move right
            if (digit(maze[x][y][0], 3) == 1) {
                return false;
            }
        } else if (newY == y - 1) {//move left
            if (digit(maze[x][y][0], 1) == 1) {
                return false;
            }
        }
        return true;
    }