calls readAndFilter function