working on the negmax algorithm