Updated with search function