public static void stop() {
		try {
			System.out.println("main: stop the program");

			// eventually write the statistics
			if (!win) {
				Gui.writeStatus();
			}
			System.out.println("main: statistics written");

			// Wait for the images to complete
			while (Gui.pro.size() != 0) {
				Gui.pro.get(0).join();
				Gui.pro.remove(0);
			}

			System.out.println("main: all images written");

			// Disconect the bricks
			while (BrickGame.bricks.size() != 0) {
				System.out.println(BrickGame.bricks.get(0).name
						+ ": disconnect");
				BrickGame.bricks.get(0).shutdown();
				BrickGame.bricks.remove(0);
			}

			System.out.println("main: all bricks disconnected, end...");

			// Close it
			System.exit(0);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			System.exit(0);
		}
	}