Added a filtering function
Passing all tests and starting histogram function