@SuppressWarnings("static-access")
	public void exit() throws IOException, InterruptedException {

		tracker.setEvent(tracker.EVENT_STOPPED);
		stopThreads = true;
		trackerThread.interrupt();
		socketListener.disconnect();
		paThread.interrupt();
		peerDisplay.interrupt();
		
		for (Peer p : peers)
		{
			if (p.amConnected())
				p.disconnect();

		}
		
		//Sleep long enough for our message handlers to finish up and our file access to close properly
		Thread.sleep(1000L);
		
		System.out.println("\nStats:");
		if (trackerStats.getUploaded() == 0)
			System.out.println("Uploaded:\t" + tracker.getUploaded());
		else 
			System.out.println("Uploaded:\t" + trackerStats.getUploaded());
		if (trackerStats.getDownloaded() > torrentInfo.file_length)
			trackerStats.setDownloaded(torrentInfo.file_length);
		else if (isDownloadComplete())
			trackerStats.setDownloaded(torrentInfo.file_length);
		else if (trackerStats.getDownloaded() == 0)
			trackerStats.setDownloaded(tracker.getDownloaded());
		System.out.println("Downloaded:\t" + trackerStats.getDownloaded());
		System.out.println("Left:\t\t" + (torrentInfo.file_length - trackerStats.getDownloaded()));
		fa.close();
		trackerStats.close();
		System.out.println("\nGoodbye!");

	}