System.out.println("popping, new element is " + pe);
    private void nextElement(Point currentPosition) {	PathElement pe = (PathElement) currentPath.getLast();	while (!pe.nextDirection()) {	    exploredTiles.add(new Point(pe.x, pe.y));	    currentPath.removeLast();	    if (currentPath.size() == 1)		break;	    pe = (PathElement) currentPath.getLast();	}	currentPosition.x = pe.x;	currentPosition.y = pe.y;    }