added an experimental data filtering function