Added option for threads