rewrote advanced search