Added code generation for filter and scan