fix selection, improve tabling