Completed select functions and tests