updated version with search and filter functions