I have a code like this, needs to be modified in such a way that - the selection condition could be passed as an argument (one of the function arguments must be lambda with a va