Added logic for three buttons in selection