Added debugging statements, stopped using ground terms for filters