basic multy-threading added