added function that unifies position filtering