Added new function to AI (master function).
Added cores parameter to new ai master function