Fixing search and extending its functionality