fixing selection bugs and added a selectAllRows function