Added filtering functionality