adding more selection code to the test() function