initial code for searching