added select() function