started changing logic to use more sparql