modified Linhaibin's code for search, but wrong result.