Efficiency Improvement. Added multi-threading