improved and remove buffer removed unused searchx