Implements select/unselect.