private void replaceCorner(Pipe p, int dir, int ID1, int ID2, int i,
			Point point) throws PointAllreadyContainsCellException {

		List<Pipe> path = actualLongestPath.getPath();
		Pipe cross = Pipe.getPipe(PipesID.CROSS.getID());
		cross.setLocation(new Point(p.getLocation()));
		((Cross) cross).setVisitedTwice(true);
		path.add(i, cross);
		if (progressive) {
			pathPrinter.removePipe(cross);
			pathPrinter.printPath(cross, i);
		}

		if (dir == EW) {
			Pipe corner1 = Pipe.getPipe(ID1);
			corner1.setLocation(new Point(p.getLocation().x + point.x, p
					.getLocation().y));
			board.add(corner1.getLocation().y, corner1.getLocation().x, corner1);
			if (progressive)
				pathPrinter.printPath(corner1, i + 1);
			path.add(i + 1, corner1);
		} else {
			Pipe corner2 = Pipe.getPipe(ID2);
			corner2.setLocation(new Point(p.getLocation().x, p.getLocation().y
					+ point.y));
			board.add(corner2.getLocation().y, corner2.getLocation().x, corner2);
			if (progressive)
				pathPrinter.printPath(corner2, i + 1);
			path.add(i + 1, corner2);
		}

		p.getLocation().x += point.x;
		p.getLocation().y += point.y;
		if (progressive)
			pathPrinter.printPath(p, i + 2);

		if (dir == EW) {
			Pipe corner1 = Pipe.getPipe(ID2);
			corner1.setLocation(new Point(p.getLocation().x - point.x, p
					.getLocation().y));
			board.add(corner1.getLocation().y, corner1.getLocation().x, corner1);
			if (progressive)
				pathPrinter.printPath(corner1, i + 3);
			path.add(i + 3, corner1);
		} else {
			Pipe corner2 = Pipe.getPipe(ID1);
			corner2.setLocation(new Point(p.getLocation().x, p.getLocation().y
					- point.y));
			board.add(corner2.getLocation().y, corner2.getLocation().x, corner2);
			if (progressive)
				pathPrinter.printPath(corner2, i + 3);
			path.add(i + 3, corner2);
		}

		addedLength += 4;
	}