added sorting, searching, errors