Compelete the main part of the script