Adds Threading based on number of cores