implement alpha-beta search