stupid hacking
worked up first cut at copying script