Added filtering functionality.