Redesigned logic of select method; added unselect method.
Added more tests for unselect method; refactored select method.