public void calculateNextDirection(int row, int column)
    {
        if (isAtHome) {
            calculateToExit();
        } else if (isCrossroad()) {
            calculateNextRandomDirection();
        } else {
            int newDirection = getDirection();
            while (!isAValidDirection(newDirection) || newDirection == (getDirection() + 2) % 4) {
                newDirection = (newDirection + 1) % 4;
            }
            setDirection(newDirection);
        }
    }