adding function for a random filter