add comments and minimax done