public int next() {
        int value = -1;
                
        try {
            value = m.getElement(next_point[0], next_point[1]);
            calculateNext();
        } catch(Matrix.MatrixError e) {}
        
        return value;
    }