rewrote the command line stuff to be simpler.