implementation of the ai alpha-beta