Implemented the applyFilter function. Added more to the class declaration.