working main search