Defined the filter method