Code for filtering variants