Add basic filtering code