liquid filtering algorithm code