Code for minimax updated, but not working