added filtering and filter generator