added clean_list to reset memory
added thread creation and completed clean_list