Improved the script.V1.1