Explained how the script works