Change to script and add significant documentation