private static int findSmallestPath(int I1, int J1, int I2, int J2) {
        q.add(new Node(I1, J1, array[I1][J1]));
        
        while (!q.isEmpty()) {
            Node current = q.poll();
            
            if (current.i == I2 && current.j == J2) {
                return current.distance;
            }
            
            evaluated[current.i][current.j] = current.distance;
            
            if (current.distance > smallest_path_definite)
                continue;
            
            add(current.up());
            add(current.down());
            //add(current.left());
            add(current.right());
        }
        
        return Integer.MAX_VALUE;
    }