Adding neighborhood filtering