implemented syncronous run() function, both joining and waiting