search function intial draft