implemented AI's turns 1 and 3