select team function