adding sorting and searching