Added an intermediate variable for the filter