added better search function