Improving script  for excersice 2