updated the decision making and added a selection method