stable script

works fairly well.  need to change names of files and convert scripts
to functions/classes and provide flags for different options