Improving the script