Added join() method to continue running main thread till all thread are
done executing.