First working version of search dialog