a better search method added