Added if for threads.
Removed printf.