First version of the script, non-funtional