First public version - UNTESTED

First draft of public version of this script. *Not tested*