implement part of the advanced search