Updated to have query, can search and sort