added search function, pagination