@SuppressWarnings("unchecked")
	private void queryTracker() {
		String trackerAddress = announce + "?" + "info_hash=" + info_hashEncoded + "&peer_id=" + client.getPeerID() + "&port=" + client.getPort() + "&uploaded=0" + // TODO: Fix these hardcoded values
				"&downloaded=0" + "&left=" + fileLength + "&compact=1" + "&event=started";
		System.out.println(trackerAddress);
		TreeMap<ByteBuffer, Object> trackerResponse = null;
		try {
			URL trackerURL = new URL(trackerAddress);
			InputStream trackerConnection = trackerURL.openStream();
			Bencode b = new Bencode(new BufferedInputStream(trackerConnection));
			trackerResponse = (TreeMap<ByteBuffer, Object>) b.getRootElement();
			trackerConnection.close();
		} catch (MalformedURLException e) {
			System.out.println("Bad URL");
			System.exit(0);
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}

		System.out.println("connection to tracker established");

		interval = (Long) getEntry(trackerResponse, "interval");
		complete = (Long) getEntry(trackerResponse, "complete");
		// TODO: TRACKERID
		incomplete = (Long) getEntry(trackerResponse, "incomplete");

		ByteBuffer rawPeers = (ByteBuffer) getEntry(trackerResponse, "peers");
		while (rawPeers.remaining() > 0) {
			int ip = rawPeers.getInt();
			short port = rawPeers.getShort();
			peers.add(new Peer(ip, port));
		}
	}