Added filtering function definitions