Updated example to auto detect the numbers of core that are available