added and used functions all() and merge() in select_demo