Added initial working version of the script.