Implemented kernel filtering. Very slow