Add ai logic to find the winning moves