added function to create a filter array