Working on an automatic filter preparation script