Mastering Counterfactual Explanations in Machine Learning