Code cleaning and script1 created