advanced search (fixes #16)