Added core functionality to select deselect buttons and added handling of cases where the active data set is empty