add support for select mode. resolves #123.