Implement category selection and contain queries to function