:added function for two threads