splitting the script into an open- and close part