implemented minimax, need to test