driver script

Added some if $0 == __FILE__ code to help quickly debug things.