added threading
#Needs Improvement