step 1: using the algorithm with a filter