Added selection support; added unit test