select logic implemented