Initial version of the script (untested)