Added filter function

Added filter function