pre- and post-processing script.  work in progress.