public int step()
    {
        boolean found=false;
        boolean growth=false;//used to check growth of the search
        GridCell goal = GridCell.getgoalCell();
        @SuppressWarnings("unchecked")
		Vector<GridCell> temp = (Vector<GridCell>) edge.clone();
        for(int i=0;i<temp.size();i++)//runs as many times as the edge vector
        {
            GridCell now = (GridCell)temp.elementAt(i); 
            GridCell next[] = map.getsurrounding(now);//creates an array of cells around the now cell
            for(int j=0;j<8;j++)//runs 8 times, once for each cell int he array
            {
                if(next[j]!=null )//checks for emptyness
                {
                    if(next[j]==goal)//checks if for goal node
                    {
                    	found=true;
                    }
                    next[j].addToPathFromStart(now.getDistFromStart());//adds to path with distance
                    
                    if(!next[j].isblock() && !edge.contains(next[j]))//if the cell isnt in either its added to edge and growth set to true
                    {
                    	edge.addElement(next[j]);
                    	growth=true;
                    }
                }
            }
            if(found)
            {
            	return FOUND;
            }
            searched.addElement(now);
        }
        map.repaint();
        
        if(!growth)//if growth isnt set to true the algorithms cannot continue
        {
        	return NO_PATH;
        }
        return NOT_FOUND;
    }