trying to enhance border filtering