First implementation of the script