added sorting and pagination to dbHelper, with tests