Implementation of the script