minor modification to 'select routine'