Added multi-threading and packet recognition.