first version of script - currently *untested*