implements minimax functionality.
-> need to make sure it will work when player selects 'o'