Made a tweak to simply the filter function