filter_reservoir function