added new select() method and implemented it