First version of script. Should work... Will resume testing at later time and update accordingly