public int searchLeftRight() {
        if (x % BOX_SIZE != 0) {
            for (int a = 0; a < MOVEMENT_SMOOTHING; a++) {
                if ((x + a) % BOX_SIZE == 0) {
                    return x + a;
                }
                if ((x - a) % BOX_SIZE == 0) {
                    return x - a;
                }
            }
            return -1;
        }
        return x;
    }