created fully automated script, totally untested