starting search code