finish implementing filtering functionality